---
import { Code } from '@astrojs/starlight/components';

const code = `
import 'package:bloc/bloc.dart';

class CounterCubit extends Cubit<int> { 
  CounterCubit() : super(0);

  void increment() => emit(state + 1);
}
`;
---

<Code code={code} lang="dart" title="counter_cubit.dart" />
